import { Settings as LayoutSettings } from '@ant-design/pro-layout'

export default function (initialState: { settings?: LayoutSettings; userinfo?: any }) {
    console.log('access -> ', initialState)
    const user = initialState?.userinfo
    return {
        adminRouteFilter: user?.role === 'admin',
        isAdmin: () => {
            return user?.role === 'admin'
        },
    }
}
